<template>
  <div class="id_card">
    <!-- <image class="id_bg" src="../images/identity_card.png"></image> -->
    <div class="id_bg"></div>
    <div class="id_card_box">
      <div class="id_card_form">
        <div class="id_card_item">
          <label class="id_card_name" for="">真实姓名：</label>
          <input class="id_card_val" type="text" :value="name" placeholder="请输入您的姓名">
        </div>
        <div class="id_card_item">
          <label class="id_card_name" for="">身份证号：</label>
          <input class="id_card_val" :value="idCard" type="idcard" maxlength="18" confirm-type="done" placeholder="请输入您的身份证号">
        </div>
        <div :class="['regis-btn',verify ? '': 'gray_btn']" @click="register">下一步</div>
        <div class="agree_serve">
          <checkbox-group @change="changeCheck">
            <checkbox :value="checkVal" class="agree_radio" type="radio" :checked="checked" color="#1c6ad7" />
          </checkbox-group>
          同意<span @click="userServe">《用户协议》</span> 和 <span @click="PrivacyPolicy">《隐私政策》</span>
        </div>
      </div>
      <div class="verify_good">
        <div class="verify_good_item" v-for="(item,index) in goodInfo" :key="index">
          <span :class="['good_img','iconfont',item.goodIcon]"></span>
          <div class="good_info">
            <div class="good_title">{{ item.name }}</div>
            <div class="good_sub">{{ item.sub }}</div>
          </div>
        </div>
      </div>
      <div class="waring_box">
        <div class="title">注意事项</div>
        <div class="warn_item" v-for="(item,index) in warnTips" :key="index">{{ item }}</div>
      </div>
    </div>
  </div>
</template>
<script setup>
  import {ref,reactive,computed} from 'vue'
  const name = ref('');
  const idCard = ref('');
  const checkVal = ref(false)
  const checked = ref(false);
  const goodInfo = reactive([
    {goodIcon:'icon-shenfenrenzheng',name:'专属认证标签 更收益性信任',sub:'实名认证后平均牵手成功率比未认证提升70%'},
    {goodIcon:'icon-anquanbaozheng',name:'解锁认证专区 认识更多用户',sub:'解锁实名专区,认识更多优质真实异性'},
    {goodIcon:'icon-OAIDjiami',name:'多重加密数据 保证信息安全',sub:'仅用于筛选虚假信息,无需担忧信息泄露'},
  ])
  const warnTips = reactive([
    '1,本人实名认证有阿里云人脸识别认证授权完成',
    '2,信息填写完毕点击下一步会跳转到第三方认证机构进行视频认证,验证过程中不能打电话或者语音视频',
    '3,请输入本人真实姓名和身份证号,如信息不符将无法通过实名认证',
    '4,如果认证过程中有遇到问题请联系月老处理',
  ])
  const verify = computed(()=>{
    return checked.value && !idCard.value && !name.value
  })
  const register = ()=>{
    console.log('去认证')
  }
  const changeCheck = e =>{
    checked.value = e.detail.value.length>0
  }
  const userServe = ()=>{
    uni.navigateTo({
      url:'/pages/my/serve'
    })
  }
  const PrivacyPolicy = ()=>{
    uni.navigateTo({
      url:'/mysub/conceal/index'
    })
  }
</script>
<style scoped lang="scss"> 
.id_card{
  .id_bg{
    width: 100%;
    height: 300px;
    background-image:url("../images/identity_card.png") no-repeat center;
    background-size: cover;
  }
  .id_card_box{
    margin:-50px 20px 0;
    background-color: #fff;
    padding: 20px;
    border-radius: 10px;
  }
  .id_card_item{
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 40px;
    border-bottom: 1px solid #f7f7f7;
    .id_card_name{
      color: #000;
      font-size: 14px;
    }
    .id_card_val{
      text-align: right;
    }
  }
  .regis-btn{
    margin:20px 5px;
    background-color: #1C6AD7;
    color: #fff;
    height: 40px;
    font-size: 14px;
    border-radius: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .gray_btn{
    cursor:not-allowed;
    pointer-events:none;
    background-color: #999;
    color: #fff;
  }
  .agree_serve{
    display: flex;
    justify-content: center;
    align-items: center;
    font-size:12px;
    color: #ccc;
    label{
      color:#1c6ad7;
    }
    .agree_radio{
      transform: scale(0.6);
    }
  }
  .verify_good{
    margin: 20px 0;
    .good_img{
      font-size: 32px;
      color: #1C6AD7;
    }
    .verify_good_item{
      display: flex;
      margin-bottom: 20px;
      .good_info{
        margin-left: 10px;
        .good_title{
          font-size: 14px;
          color: #000;
          list-style: 16px;
        }
        .good_sub{
          font-size: 12px;
          color: #666;
          list-style: 16px;
        }
      }
    }
  }
  .waring_box{
    .title{
      font-size: 14px;
      color: #1C6AD7;
      padding-left: 10px;
      position: relative;
      margin-bottom: 10px;
      &::before{
        content:' ';
        position: absolute;
        background-color: #1C6AD7;
        left: 0;
        width: 4px;
        height: 100%;
      }
    }
    .warn_item{
      font-size: 12px;
      color: #666;
      margin-bottom: 5px;
    }
  }
}
</style>